package main

import (
	"fmt"
	"github.com/spf13/viper"
	"os"
)

func main() {
	path, err := os.Getwd()
	if err != nil {
		fmt.Println("error.")
	}

	viper.AddConfigPath(path + "/examples/viper/conf")
	viper.SetConfigName("application-dev")
	viper.SetConfigType("yaml")

	if err := viper.ReadInConfig(); err != nil {
		fmt.Println("error2.")
	}

	driver := viper.Get("database.driver")
	fmt.Println(driver)

}
